<?
require("config.php");

$table = "course_schedule";

$field = array(

"id",
"name",
"datedetails",
"time",
"venue",
"country",
"presented",
"currency",
"fee",
"remark",
"contact",
"contact_tel",
"contact_email",
	"currency1",
	"currency2",
	"currency3",
	"currency4",
	"currency5",
	"fee1",
	"fee2",
	"fee3",
	"fee4",
	"fee5",
	"description1",
	"description2",
	"description3",
	"description4",
	"description5",
    "price"
);

if (!$id) $exp = "order by id desc Limit 1";


if ($id) $exp = "AND id=$id Limit 1";

$r = limitQuery($table,$field,$exp);

$id=$r[0][0];
$name=$r[0][1];
$datedetails=$r[0][2];
$time=$r[0][3];
$venue=$r[0][4];
$country=$r[0][5];
$presented=$r[0][6];
$currency=$r[0][7];
$fee=$r[0][8];
$remark=$r[0][9];
$contact=$r[0][10];
$contact_tel=$r[0][11];
$contact_email=$r[0][12];





	$Currency1= $r[0][13];
	$Currency2= $r[0][14];
	$Currency3= $r[0][15];
	$Currency4= $r[0][16];
	$Currency5= $r[0][17];
	$Fee1= $r[0][18];
	$Fee2= $r[0][19];
	$Fee3= $r[0][20];
	$Fee4= $r[0][21];
	$Fee5= $r[0][22];
	$Description1= $r[0][23];
	$Description2= $r[0][24];
	$Description3= $r[0][25];
	$Description4= $r[0][26];
	$Description5= $r[0][27];
	$Price=$r[0][28];

?>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Schedule Detail</title>
<link href="images/css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {font-style: italic}
-->
</style>
</head>

<body bgcolor="7DA7D9" scroll="yes">
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="13"><img src="images/c1.gif" width="13" height="37"></td>
          <td background="images/c5.gif"> <font color="#FFFFFF"> 
            <?=$name?>
            </font></td>
          <td width="13"><img src="images/c2.gif" width="13" height="37"></td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="2" bgcolor="B1CAE8"><img src="images/shim.gif" width="2" height="1"></td>
          <td align="center"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td bgcolor="F78D83"><img src="images/shim.gif" width="1" height="2"></td>
              </tr>
            </table>
            <table width="96%" border="0" align="center" cellspacing="0" cellpadding="0">
<tr> 
                <td colspan="2" height="4"></td>
              </tr>
              <?if ($datedetails){?>
              <tr> 
                <td height="24"> <b>Start on </b></td>
                <td width="82%" height="24"> 
                  <?=$datedetails?></td>
              </tr>
<tr> 
                <td colspan="2" height="4"></td>
              </tr>
							
              <tr> 
                <td colspan="2" background="images/line.gif"><img src="images/shim.gif" width="1" height="1"></td>
              </tr>

              <?}?>

<tr> 
                <td colspan="2" height="4"></td>
              </tr>
              <?if ($time){?>
              <tr> 
                <td height="24"> <b>Time</b></td>
                <td> 
                  <?=$time?>                </td>
              </tr>
<tr> 
                <td colspan="2" height="4"></td>
              </tr>
              <tr> 
                <td colspan="2" background="images/line.gif"><img src="images/shim.gif" width="1" height="1" class="style1"></td>
              </tr>


              <?}?>

<tr> 
                <td colspan="2" height="4"></td>
              </tr>

              <?if ($venue){?>
              <tr> 
                <td width=100 height="24"> <b>Venue</b></td>
                <td> 
                  <?=$venue?>                </td>
              </tr>
<tr> 
                <td colspan="2" height="4"></td>
              </tr>
              <tr> 
                <td colspan="2" background="images/line.gif"><img src="images/shim.gif" width="1" height="1"></td>
              </tr>

              <?}?>
<tr> 
                <td colspan="2" height="4"></td>
              </tr>
			
              <?if ($country){?>
              <tr> 
                <td height="24"> <b>Country</b></td>
                <td> 
                  <?=$country?>                </td>
              </tr>
							<tr> 
                <td colspan="2" height="4"></td>
              </tr>
              <tr> 
                <td colspan="2" background="images/line.gif"><img src="images/shim.gif" width="1" height="1"></td>
              </tr>


              <?}?>
<tr> 
                <td colspan="2" height="4"></td>
              </tr>

              <?if ($presented){?>
              <tr> 
                <td height="24"> <b>Presented in </b></td>
                <td> 
                  <?=$presented?>                </td>
              </tr>
<tr> 
                <td colspan="2" height="4"></td>
              </tr>
              <tr> 
                <td colspan="2" background="images/line.gif"><img src="images/shim.gif" width="1" height="1"></td>
              </tr>

              <?}?>
              <?
	if ($fee==0){

		$Fee = "Free";

		$button = "Registration";

	}else{

		$Fee = "<i>$currency $fee</i>";

		$button = "Online Enroll";

	}
		
?><tr> 
                <td colspan="2" height="4"></td>
              </tr>
              <tr> 
                <td height="24"><b>Fee</b></td>
                <td> 


<?

for ($i=1;$i<4;$i++){

	$v1="Currency$i";
	$v2="Fee$i";
	$v3="Description$i";


	if ($$v2>0){
		echo $$v1 . " " . number_format($$v2,2) ." <span class=note>" . $$v3 . "</span><br>";
	}
}
    //if ($Price>0){
//		echo  $Currency1. " " . number_format($Price,2) ." <br><span class=note>" . $Description1 . "</span>";
//	}
?>                

</td>
              </tr>
<tr> 
                <td colspan="2" height="4"></td>
              </tr>
              <tr> 
                <td colspan="2" background="images/line.gif"><img src="images/shim.gif" width="1" height="1"></td>
              </tr>
<tr> 
                <td colspan="2" height="4"></td>
              </tr>

              <tr> 
                <td height="24"><strong>Remark</strong></td>
                <td> 
                  <?=$remark?>                </td>
              </tr>
<tr> 
                <td colspan="2" height="4"></td>
              </tr>
              <tr> 
                <td colspan="2" background="images/line.gif"><img src="images/shim.gif" width="1" height="1"></td>
              </tr>

<tr> 
                <td colspan="2" height="4"></td>
              </tr>

              <?if ($contact){?>
              <tr> 
                <td height="24"><strong>Contact</strong></td>
                <td> 
                  <?=$contact?>                </td>
              </tr>
<tr> 
                <td colspan="2" height="4"></td>
              </tr>
              <tr> 
                <td colspan="2" background="images/line.gif"><img src="images/shim.gif" width="1" height="1"></td>
              </tr>

              <?}?>

<tr> 
                <td colspan="2" height="4"></td>
              </tr>
              <?if ($contact_tel){?>
              <tr> 
                <td height="24"><strong>Tel</strong></td>
                <td> 
                  <?=$contact_tel?>                </td>
              </tr>
<tr> 
                <td colspan="2" height="4"></td>
              </tr>
              <tr> 
                <td colspan="2" background="images/line.gif"><img src="images/shim.gif" width="1" height="1"></td>
              </tr>

              <?}?>


<tr> 
                <td colspan="2" height="4"></td>
              </tr>
              <?if ($contact_email){?>
              <tr> 
                <td height="24"><strong>Email</strong></td>
                <td><a href="mailto:<?=$contact_email?>"> 
                  <?=$contact_email?>
                  </a></td>
              </tr>
<tr> 
                <td colspan="2" height="4"></td>
              </tr>
              <tr> 
                <td colspan="2" background="images/line.gif"><img src="images/shim.gif" width="1" height="1"></td>
              </tr>

              <?}?>
            </table>
            <p> 
              <input name="button" type="button" class="button" onClick="top.close()" value="close">
              <br>
              <br>
            </p></td>
          <td width="2" bgcolor="B1CAE8"><img src="images/shim.gif" width="2" height="1"></td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="6"><img src="images/c3.gif" width="6" height="6"></td>
          <td background="images/c7.gif"><img src="images/c7.gif" width="6" height="6"></td>
          <td width="6"><img src="images/c4.gif" width="6" height="6"></td>
        </tr>
      </table></td>
  </tr>
</table>
<br>
<div align="center"> </div>

</body>
</html>
